package com.nahan.secondapplication.ImitateDouYin

import android.content.Context
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.nahan.secondapplication.R
import kotlinx.android.synthetic.main.activity_fang_dou_yin.*

class FangDouYinActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_fang_dou_yin)


        var entity=CommentListEntity()
        var rowsBeans:MutableList<CommentListEntity.RowsBean> = ArrayList()


        for (j in 0..3)
        {
            var replys:MutableList<CommentListEntity.RowsBean.ReplysBean> = ArrayList()
            for (i in 0 until j)
            {
                var reply=CommentListEntity.RowsBean.ReplysBean(
                    "1","自己","回复内容", "回复时间",
                    "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3370302115,85956606&fm=26&gp=0.jpg"
                    ,"评论名字"
                )
                replys.add(reply)
            }
            var rowsBean=CommentListEntity.RowsBean(
                j,j,j,"我的","https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3370302115,85956606&fm=26&gp=0.jpg","评论内容",
                "0","3小时前",1,j,2,if (j==0) null else replys
            )
            rowsBeans.add(rowsBean);
        }
        entity.rows=rowsBeans



        fang.setOnClickListener {
            //tag 作区分加载哪个的评论数据
            val commentBottomSheetDialogFragment =
                CommentBottomSheetDialogFragment(this, entity)
            commentBottomSheetDialogFragment.show(supportFragmentManager, "")
        }
    }
}